package org.example.service.impl;

import java.util.List;

import org.example.domain.UtcItemRecord;
import org.example.mapper.UtcItemRecordMapper;
import org.example.service.IUtcItemRecordService;
import org.example.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * recordService业务层处理
 * 
 * @author coderfun
 * @date 2024-11-27
 */
@Service
public class UtcItemRecordServiceImpl implements IUtcItemRecordService
{
    @Autowired
    private UtcItemRecordMapper utcItemRecordMapper;

    /**
     * 查询record
     * 
     * @param itemId record主键
     * @return record
     */
    @Override
    public UtcItemRecord selectUtcItemRecordByItemId(Long itemId)
    {
        return utcItemRecordMapper.selectUtcItemRecordByItemId(itemId);
    }

    /**
     * 查询record列表
     * 
     * @param utcItemRecord record
     * @return record
     */
    @Override
    public List<UtcItemRecord> selectUtcItemRecordList(UtcItemRecord utcItemRecord)
    {
        return utcItemRecordMapper.selectUtcItemRecordList(utcItemRecord);
    }

    /**
     * 新增record
     * 
     * @param utcItemRecord record
     * @return 结果
     */
    @Override
    public int insertUtcItemRecord(UtcItemRecord utcItemRecord)
    {
        return utcItemRecordMapper.insertUtcItemRecord(utcItemRecord);
    }

    /**
     * 修改record
     * 
     * @param utcItemRecord record
     * @return 结果
     */
    @Override
    public int updateUtcItemRecord(UtcItemRecord utcItemRecord)
    {
        utcItemRecord.setUpdateTime(DateUtils.getNowDate());
        return utcItemRecordMapper.updateUtcItemRecord(utcItemRecord);
    }

    /**
     * 批量删除record
     * 
     * @param itemIds 需要删除的record主键
     * @return 结果
     */
    @Override
    public int deleteUtcItemRecordByItemIds(Long[] itemIds)
    {
        return utcItemRecordMapper.deleteUtcItemRecordByItemIds(itemIds);
    }

    /**
     * 删除record信息
     * 
     * @param itemId record主键
     * @return 结果
     */
    @Override
    public int deleteUtcItemRecordByItemId(Long itemId)
    {
        return utcItemRecordMapper.deleteUtcItemRecordByItemId(itemId);
    }
}
